using System;
using System.Collections.Generic;
using System.Text;

namespace MIMPWinForms
{
    /// <summary>
    /// A generic wrapper for EventArgs with a single EventData property of the specified type.
    /// </summary>
    /// <typeparam name="T">The type of the EventData property.</typeparam>
    public class EventArgs<T> : EventArgs
    {
        /// <summary>
        /// Constructs a new EventArgs with the given event data.
        /// </summary>
        /// <param name="value">The data accompanying this event.</param>
        public EventArgs(T data)
        {
            edata = data;
        }

        private T edata;
        /// <summary>
        /// The data accompanying this event.
        /// </summary>
        public T EventData
        {
            get { return edata; }
        }
    }

    /// <summary>
    /// A generic wrapper for EventArgs with a two EventData properties, called PrimaryEventData and SecondaryEventData, of the specified types.
    /// </summary>
    /// <typeparam name="T">The type of the PrimaryEventData property.</typeparam>
    /// <typeparam name="U">The type of the SecondaryEventData property.</typeparam>
    public class EventArgs<T, U> : EventArgs
    {
        /// <summary>
        /// Constructs a new EventArgs with the given event data.
        /// </summary>
        /// <param name="primary">The primary data accompanying this event.</param>
        /// <param name="secondary">The secondary data accompanying this event.</param>
        public EventArgs(T primary, U secondary)
        {
            pdata = primary;
            sdata = secondary;
        }

        private T pdata;
        private U sdata;
        /// <summary>
        /// The primary data accompanying this event.
        /// </summary>
        public T PrimaryEventData
        {
            get { return pdata; }
        }
        /// <summary>
        /// The secondary data accompanying this event.
        /// </summary>
        public U SecondaryEventData
        {
            get { return sdata; }
        }
    }

    /// <summary>
    /// A generic wrapper for EventArgs with a three EventData properties, called PrimaryEventData, SecondaryEventData, and TertiaryEventData, of the specified types.
    /// </summary>
    /// <typeparam name="T">The type of the PrimaryEventData property.</typeparam>
    /// <typeparam name="U">The type of the SecondaryEventData property.</typeparam>
    /// <typeparam name="V">The type of the TertiaryEventData property.</typeparam>
    public class EventArgs<T, U, V> : EventArgs
    {
        /// <summary>
        /// Constructs a new EventArgs with the given event data.
        /// </summary>
        /// <param name="primary">The primary data accompanying this event.</param>
        /// <param name="secondary">The secondary data accompanying this event.</param>
        /// <param name="tertiary">The tertiary data accompanying this event.</param>
        public EventArgs(T primary, U secondary, V tertiary)
        {
            pdata = primary;
            sdata = secondary;
            tdata = tertiary;
        }

        private T pdata;
        private U sdata;
        private V tdata;
        /// <summary>
        /// The primary data accompanying this event.
        /// </summary>
        public T PrimaryEventData
        {
            get { return pdata; }
        }
        /// <summary>
        /// The secondary data accompanying this event.
        /// </summary>
        public U SecondaryEventData
        {
            get { return sdata; }
        }
        /// <summary>
        /// The tertiary data accompanying this event. 
        /// </summary>
        public V TertiaryEventData
        {
            get { return tdata; }
        }
    }
}
